﻿<%@ Page Language="C#" Title="路线评定汇总" MasterPageFile="~/W_View/PageMaster.Master"  CodeBehind="E_EvaluPage.aspx.cs" Inherits="STHPMS1.Web.W_View.Evaluate.E_EvaluPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <%= UiHelper.RefJsFileHtml("/Scripts/Control/datagrid.js")%>
    <%= UiHelper.RefJsFileHtml("/Scripts/Control/dropdown.js")%>

    <script type="text/javascript">
        function B_PmstcEdit(flag) {
            var row = $('#dg').datagrid('getSelected');
            var title = "";
            if (flag == 0) {
                if (!row) {
                    $.messager.alert('消息提示', '编辑数据时，请选择一项!', 'warning');
                    return;
                }
                $('#fm').form('load', row);
                title = "新增测试数据";
            }
            else {
                $('#fm').form('clear');
                title = "编辑测试数据";
            }
            $('#dlg').dialog('open');
        }

        function search(n, o) {
            var road = $('#cmbRoads').combobox("getValue");

            var url = '/api/evalu';
            var urlParam = "";
            if (road != "" && road != "0") urlParam += "road=" + encodeURI(road) + "&";
            if (urlParam != "") {
                urlParam = "?" + urlParam.substring(0, urlParam.length - 1);
                url = url + urlParam;
            }

            $('#dg').datagrid({ url: url, pageNumber: 1 });
        }

        $(function () {
            var number = '<%= Page.RouteData.Values["page"] %>';
            var size = '<%= Page.RouteData.Values["size"] %>';

            loadAdmDiv();
            dataGridBind($('#dg'), '', '路线评定汇总', $('#tb'), number, size);

            $('.validatebox-text').bind('blur', function () {
                $(this).validatebox('enableValidation').validatebox('validate');
            });
        })

        function Insert()
        {
            var inspecid = $('#cmbInspecid').combobox("getValue"); //评定名称
            var road = $('#cmbRoadway').combobox("getValue"); //路线编号
            if(!inspecid)
            {
                $.messager.alert('消息提示', '请选择评定名称！', 'warning');
                return;
            }

            $.ajax({

                url: "/api/evalu/GetSaveEvalu?inspecid=" + inspecid + "&rdwayid=" + road + "",
                success: function () {
                    $.messager.alert('成功', '路线评定成功!', "info");
                    $('#dg').datagrid({ url: '/api/evalu', pageNumber: 1 });
                },
                error: function (err) {
                    $.messager.alert('错误提示', '删除数据失败 -' + err, "error");
                }
            });

        }

    </script>    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table id="dg" class="easyui-datagrid content-place"  ajaxCached="false"  >
        <thead>

            <tr>
                <th rowspan="2" data-options="field:'Inspecid',editor:'text',width:150,align:'right' ">评定名称</th>
                <th rowspan="2" data-options="field:'Svydata',editor:'text',width:60,align:'right' " >评定时间 </th>
                <th rowspan="2" data-options="field:'Rdwayid',editor:'text',width:60,align:'right' ">路线编号</th>
                <%--<th rowspan="2" data-options="field:'Admdiv',editor:'numberbox',width:100,align:'right' " formatter="formatAdmdiv">行政区域</th>--%>
                <th rowspan="2" data-options="field:'Evalu_Length',editor:'numberbox',width:80,align:'right' " >评定长度/KM</th>
                <%--<th rowspan="2" data-options="field:'Svydata',editor:'text',width:60,align:'right' " >调查日期 </th>
                <th rowspan="2" data-options="field:'Direction_Dictid',editor:'text',width:60,align:'right' " formatter="formatDirection">调查方向</th>--%>
                <th rowspan="2" data-options="field:'Evalucalss_Dictid',editor:'text',width:60,align:'right' " formatter="formatEvalucalss">评定等级</th>

                <th  colspan="3">MQI比例/%</th>
                <th  colspan="3">PQI比例/%</th>
                <th  colspan="3">SCI比例/%</th>
                <th  colspan="3">TCI比例/%</th>
                <th  colspan="3">BCI比例/%</th>

                <th  colspan="3">MQI路段长度/KM</th>
                <th  colspan="3">PQI路段长度/KM</th>
                <th  colspan="3">SCI路段长度/KM</th>
                <th  colspan="3">TCI路段长度/KM</th>
                <th  colspan="3">BCI路段长度/KM</th>
            </tr>
            
            <tr>

                <th data-options="field:'Gdrdrate_Mqi',editor:'text',width:40,align:'right' " formatter="formatNumber">优良</th>
                <th data-options="field:'Mdrdrate_Mqi',editor:'text',width:40,align:'right' " formatter="formatNumber">中等</th>
                <th data-options="field:'Bardrate_Mqi',editor:'text',width:40,align:'right' " formatter="formatNumber">次差</th>
                                                                           
                <th data-options="field:'Gdrdrate_Pqi',editor:'text',width:40,align:'right' " formatter="formatNumber">优良</th>
                <th data-options="field:'Mdrdrate_Pqi',editor:'text',width:40,align:'right' " formatter="formatNumber">中等</th>
                <th data-options="field:'Bardrate_Pqi',editor:'text',width:40,align:'right' " formatter="formatNumber">次差</th>
                                                                                              
                <th data-options="field:'Gdrdrate_Sci',editor:'text',width:40,align:'right' " formatter="formatNumber">优良</th>
                <th data-options="field:'Mdrdrate_Sci',editor:'text',width:40,align:'right' " formatter="formatNumber">中等</th>
                <th data-options="field:'Bardrate_Sci',editor:'text',width:40,align:'right' " formatter="formatNumber">次差</th>
                                                                                              
                <th data-options="field:'Gdrdrate_Tci',editor:'text',width:40,align:'right' " formatter="formatNumber">优良</th>
                <th data-options="field:'Mdrdrate_Tci',editor:'text',width:40,align:'right' " formatter="formatNumber">中等</th>
                <th data-options="field:'Bardrate_Tci',editor:'text',width:40,align:'right' " formatter="formatNumber">次差</th>
                                                                                              
                <th data-options="field:'Gdrdrate_Bci',editor:'text',width:40,align:'right' " formatter="formatNumber">优良</th>
                <th data-options="field:'Mdrdrate_Bci',editor:'text',width:40,align:'right' " formatter="formatNumber">中等</th>
                <th data-options="field:'Bardrate_Bci',editor:'text',width:40,align:'right' " formatter="formatNumber">次差</th>
                                                                                              
                <th data-options="field:'Gdlength_Mqi',editor:'text',width:50,align:'right' " >优良</th>
                <th data-options="field:'Bdlength_Mqi',editor:'text',width:50,align:'right' " >中等</th>
                <th data-options="field:'Mdlength_Mqi',editor:'text',width:50,align:'right' " >次差</th>
                                                                                          
                <th data-options="field:'Gdlength_Pqi',editor:'text',width:50,align:'right' " >优良</th>
                <th data-options="field:'Mdlength_Pqi',editor:'text',width:50,align:'right' " >中等</th>
                <th data-options="field:'Bdlength_Pqi',editor:'text',width:50,align:'right' " >次差</th>
                                                                                          
                <th data-options="field:'Gdlength_Sci',editor:'text',width:50,align:'right' " >优良</th>
                <th data-options="field:'Mdlength_Sci',editor:'text',width:50,align:'right' " >中等</th>
                <th data-options="field:'Bdlength_Sci',editor:'text',width:50,align:'right' " >次差</th>
                                                                                          
                <th data-options="field:'Gdlength_Tci',editor:'text',width:50,align:'right' " >优良</th>
                <th data-options="field:'Mdlength_Tci',editor:'text',width:50,align:'right' " >中等</th>
                <th data-options="field:'Bdlength_Tci',editor:'text',width:50,align:'right' " >次差</th>
                                                                                          
                <th data-options="field:'Gdlength_Bci',editor:'text',width:50,align:'right' " >优良</th>
                <th data-options="field:'Mdlength_Bci',editor:'text',width:50,align:'right' " >中等</th>
                <th data-options="field:'Bdlength_Bci',editor:'text',width:50,align:'right' " >次差</th>
            </tr>

            

        </thead>
    </table>
   
    <!--测试数据命令-->
    <div id="tb">
        <select id="cmbInspecid" class="easyui-combobox" panelHeight="80" style="width:150px" data-options="prompt:'评定名称',url:'/api/roadwaydetail/getinspecid',method:'get',valueField:'id',textField:'id',onSelect:function(rect){ 
                            var stfu_url = '/api/roadwaydetail/getroadwayid?inspecid='+rect.id;
                             
                            $('#cmbRoadway').combobox('reload', stfu_url).combobox('clear');
                        }">
         </select>
        <select id="cmbRoadway" class="easyui-combobox" panelHeight="80" style="width:100px" data-options="prompt:'路线编号',method:'get',valueField:'id',textField:'id'">
         </select>
        
        <%--<input id='Admdiv' name='Admdiv'  class="easyui-combotree" style="width:200px" data-options="prompt:'行政区域',url:'/api/data/regioncode',method:'get'"/>
        <input id="Admgrd" name='Admgrd'  class="easyui-combobox" style="width:80px" data-options="prompt:'行政等级',valueField:'id',textField:'text',url:'/api/data/adminlevel',method:'get'"/>
        <input id="Rdclass_Dictid" name='Rdclass_Dictid'  class="easyui-combobox" style="width:80px" data-options="prompt:'技术等级',valueField:'id',textField:'text',url:'/api/data/roadclass',method:'get'"/>
        <input id="Pvmttype"  name='Pvmttype'  class="easyui-combobox" style="width:80px" data-options="prompt:'路面类型',valueField:'id',textField:'text',url:'/api/data/pavement',method:'get'"/>
        <input name='Manaut' class='easyui-validatebox easyui-textbox' style="width:80px"  data-options="prompt:'管养单位',validType:'MaxLength[1000]'"/>--%>

        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true" onclick="Insert();">路线评定</a>
    </div>

</asp:Content>
